<!DOCTYPE html>
<html lang="">

<head>
	<meta name="generator" content="Hugo 0.73.0" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="author" content="Ap Chen ">
<meta name="description" content="软件支持 产品缺陷性支持与非缺陷性支持 支持成本 商用软件：服务收费 开源软件：Stackoverflow, github 外层：客服 咨询电话 在线提交问题 技术问题" />
<meta name="keywords" content="blog" />
<meta name="robots" content="noodp" />

<link rel="canonical" href="https://fziks.gitee.io/notes/software-enginerring/8-%E8%BD%AF%E4%BB%B6%E7%BB%B4%E6%8A%A4%E5%92%8C%E6%BC%94%E5%8C%96/" />

<meta itemprop="name" content="8-软件维护和演化">
<meta itemprop="description" content="软件支持 产品缺陷性支持与非缺陷性支持 支持成本 商用软件：服务收费 开源软件：Stackoverflow, github 外层：客服 咨询电话 在线提交问题 技术问题">
<meta itemprop="datePublished" content="2018-11-13T00:00:00&#43;00:00" />
<meta itemprop="dateModified" content="2018-11-13T00:00:00&#43;00:00" />
<meta itemprop="wordCount" content="1033">



<meta itemprop="keywords" content="" />
<meta property="og:title" content="8-软件维护和演化" />
<meta property="og:description" content="软件支持 产品缺陷性支持与非缺陷性支持 支持成本 商用软件：服务收费 开源软件：Stackoverflow, github 外层：客服 咨询电话 在线提交问题 技术问题" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://fziks.gitee.io/notes/software-enginerring/8-%E8%BD%AF%E4%BB%B6%E7%BB%B4%E6%8A%A4%E5%92%8C%E6%BC%94%E5%8C%96/" />
<meta property="article:published_time" content="2018-11-13T00:00:00+00:00" />
<meta property="article:modified_time" content="2018-11-13T00:00:00+00:00" />

<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="8-软件维护和演化"/>
<meta name="twitter:description" content="软件支持 产品缺陷性支持与非缺陷性支持 支持成本 商用软件：服务收费 开源软件：Stackoverflow, github 外层：客服 咨询电话 在线提交问题 技术问题"/>


<link rel="apple-touch-icon" sizes="60x60" href="https://fziks.gitee.io/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://fziks.gitee.io/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://fziks.gitee.io/icons/favicon-16x16.png">
<link rel="manifest" href="https://fziks.gitee.io/icons/site.webmanifest">
<link rel="mask-icon" href="https://fziks.gitee.io/icons/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="https://fziks.gitee.io/icons/favicon.ico">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-config" content="/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">

<title>8-软件维护和演化</title>


<link rel="stylesheet" href="//at.alicdn.com/t/font_1559566_wk214kwa2dn.css">


    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">



    
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css" integrity="sha256-WAgYcAck1C1/zEl5sBl5cfyhxtLgKGdpI3oKyJffVRI=" crossorigin="anonymous" />
    
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.css" integrity="sha256-a2tobsqlbgLsWs7ZVUGgP5IvWZsx8bTNQpzsqCSm5mk=" crossorigin="anonymous" />
    
   <link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/materia/bootstrap.min.css" rel="stylesheet" integrity="sha384-1tymk6x9Y5K+OF0tlmG2fDRcn67QGzBkiM3IgtJ3VrtGrIi5ryhHjKjeeS60f1FA" crossorigin="anonymous">
    
    
    <link rel="stylesheet" href="https://fziks.gitee.io/sass/main_cdn.min.270b43bb8631af4497ed45b90db42c517e86c9511418de9152f134d02ed32b87.min.2192baea245cf318085511589e62bfbdb3fbe4fb0eef718f1be9af91c10542ce.css" integity="sha256-IZK66iRc8xgIVRFYnmK/vbP75PsO73GPG&#43;mvkcEFQs4=">

</head>

<body style="overflow-x: unset;">
	<div class="container-fluid">
		<div class="row d-print-block">
			<div class="col-12 col-md-3 col-lg-2 bd-sidebar d-print-none">
				<div class="d-flex mt-3 border-bottom">
        <span class="navbar-brand w-100" style="display: grid;">
            <small>
                <a href="https://fziks.gitee.io/" class="text-black-50">
                    <i class="iconfont icon-back-arrow-"></i>
                </a>
                Ap Chen's
            </small>
            <a class="text-dark" href="https://fziks.gitee.io/notes/">
                Notes
            </a>
        </span>
        <button class="btn btn-link text-dark d-md-none p-0 ml-3" type="button" data-toggle="collapse"
            data-target="#bd-docs-nav" aria-controls="bd-docs-nav" aria-expanded="true"
            aria-label="Toggle docs navigation">
            <i class="fad fa-bars"></i>
        </button>
    </div>
				<nav id="bd-docs-nav" class="collapse bd-links">
    
    
    
    <div class="bd-toc-item">
        <a class="bd-toc-link" href="https://fziks.gitee.io/notes/computer-network/">
            
            
                <span class="icontext">S</span>
            
            
            计算机网络
        </a>
    </div>
    
    
    
    <div class="bd-toc-item">
        <a class="bd-toc-link" href="https://fziks.gitee.io/notes/operating-system/">
            
            
                <span class="icontext">S</span>
            
            
            操作系统
        </a>
    </div>
    
    
    
    <div class="bd-toc-item">
        <a class="bd-toc-link" href="https://fziks.gitee.io/notes/database/">
            
            
                <span class="icontext">S</span>
            
            
            数据库
        </a>
    </div>
    
    
    
    <div class="bd-toc-item">
        <a class="bd-toc-link" href="https://fziks.gitee.io/notes/cs50-introduction-to-computer-science/">
            
            
                <span class="icontext">S</span>
            
            
            CS50 MIT
        </a>
    </div>
    
    
    
    <div class="bd-toc-item active bg-light">
        <a class="bd-toc-link" href="https://fziks.gitee.io/notes/software-enginerring/">
            <i class="iconfont icon-back-arrow-reverse"></i>
            软件工程
        </a>
        <ul class="nav bd-sidenav">
            
            
            <li>
                <a href="https://fziks.gitee.io/notes/software-enginerring/1-%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B%E5%BC%95%E8%AE%BA/">1-软件工程引论</a>
            </li>
            
            
            
            <li>
                <a href="https://fziks.gitee.io/notes/software-enginerring/2-%E8%BD%AF%E4%BB%B6%E8%BF%87%E7%A8%8B%E6%A8%A1%E5%9E%8B/">2-软件过程模型</a>
            </li>
            
            
            
            <li>
                <a href="https://fziks.gitee.io/notes/software-enginerring/3-%E8%BD%AF%E4%BB%B6%E9%9C%80%E6%B1%82/">3-软件需求与分析</a>
            </li>
            
            
            
            <li>
                <a href="https://fziks.gitee.io/notes/software-enginerring/4-%E8%BD%AF%E4%BB%B6%E8%AE%BE%E8%AE%A1-sa/">4-软件设计-SA</a>
            </li>
            
            
            
            <li>
                <a href="https://fziks.gitee.io/notes/software-enginerring/5-%E8%BD%AF%E4%BB%B6%E8%AE%BE%E8%AE%A1-ooad/">5-软件设计-OOAD</a>
            </li>
            
            
            
            <li>
                <a href="https://fziks.gitee.io/notes/software-enginerring/6-%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/">6-设计模式</a>
            </li>
            
            
            
            <li>
                <a href="https://fziks.gitee.io/notes/software-enginerring/7-%E8%BD%AF%E4%BB%B6%E6%B5%8B%E8%AF%95%E5%92%8C%E9%AA%8C%E8%AF%81/">7-软件测试和验证</a>
            </li>
            
            
            
            <li class="active">
                <a href="https://fziks.gitee.io/notes/software-enginerring/8-%E8%BD%AF%E4%BB%B6%E7%BB%B4%E6%8A%A4%E5%92%8C%E6%BC%94%E5%8C%96/">
                    <i class="fad fa-chevron-right mr-1"></i>
                    8-软件维护和演化
                </a>
            </li>
            
            
            
            <li>
                <a href="https://fziks.gitee.io/notes/software-enginerring/9-%E5%AE%9E%E9%99%85%E5%BC%80%E5%8F%91%E6%B5%81%E7%A8%8B%E6%A1%88%E4%BE%8B/">9-实际开发流程案例</a>
            </li>
            
            
        </ul>
    </div>
    
    
    
    <div class="bd-toc-item">
        <a class="bd-toc-link" href="https://fziks.gitee.io/notes/advanced-programming/">
            
            
                <span class="icontext">A</span>
            
            
            高级程序设计
        </a>
    </div>
    
    
    
    <div class="bd-toc-item">
        <a class="bd-toc-link" href="https://fziks.gitee.io/notes/deep-learning/">
            
            
                <span class="icontext">O</span>
            
            
            深度学习基础
        </a>
    </div>
    
    
    
    <div class="bd-toc-item">
        <a class="bd-toc-link" href="https://fziks.gitee.io/notes/%E6%96%87%E7%8C%AE%E7%AE%A1%E7%90%86%E4%B8%8E%E4%BF%A1%E6%81%AF%E5%88%86%E6%9E%90/">
            
            
                <span class="icontext">O</span>
            
            
            文献管理与信息分析
        </a>
    </div>
    
    
</nav>
			</div>
			<div class="col-12 col-md-9 col-lg-10 d-print-block">
				<div class="row d-print-block">
					<main class="col-12 col-md-10 col-lg-9 py-md-3 pl-md-5 bd-content d-print-block" role="main">
						<div id="title" class="my-4 border-bottom">
							<span>软件工程</span>
							<h2>8-软件维护和演化</h2>
							<footer>
								<span>
									<i class="iconfont icon-NewFile mr-2"></i>
									2018-11-13 08:00 CST
								</span> <br />
								<span>
									<i class="iconfont icon-modify mr-2"></i>
									2018-11-13 08:00 CST
								</span> <br />
								<span>
									<i class="iconfont icon-copyright mr-2"></i>
									CC BY-NC 4.0
								</span>
							</footer>
						</div>
						<div id="content" class="hl-h2">
							
							
							
							
							
							
							
							
							
							
							
							
							<h2 id="软件支持">软件支持<a href="#软件支持" class="anchor" aria-hidden="true"><i class="iconfont icon-link"></i></a></h2>
<ul>
<li>产品缺陷性支持与非缺陷性支持</li>
<li>支持成本
<ul>
<li>商用软件：服务收费</li>
<li>开源软件：Stackoverflow, github</li>
</ul>
</li>
<li>外层：客服
<ul>
<li>咨询电话</li>
<li>在线提交问题</li>
</ul>
</li>
<li>技术问题
<ul>
<li>交付及安装补丁集</li>
</ul>
</li>
</ul>
<h2 id="软件维护">软件维护<a href="#软件维护" class="anchor" aria-hidden="true"><i class="iconfont icon-link"></i></a></h2>
<ul>
<li>软件维护原则
<ul>
<li>不损害程序的质量</li>
<li>保持程序风格的一致性和功能的完整性</li>
<li>应有利于将来程序的改变</li>
<li>对用户没有不利的影响</li>
</ul>
</li>
<li>基于缺陷的软件维护
<ul>
<li>缺陷定位/调试：程序频谱</li>
<li>缺陷修复：自动修复技术</li>
<li>回归测试</li>
<li>集成</li>
</ul>
</li>
</ul>
<h2 id="软件演化">软件演化<a href="#软件演化" class="anchor" aria-hidden="true"><i class="iconfont icon-link"></i></a></h2>
<ul>
<li>变更控制
<ul>
<li>发起变更请求</li>
<li>批准变更请求</li>
<li>执行变更请求</li>
<li>跟踪和关闭变更请求</li>
</ul>
</li>
<li>程序理解</li>
<li>二次开发</li>
<li>集成</li>
</ul>
<h2 id="devops">Devops<a href="#devops" class="anchor" aria-hidden="true"><i class="iconfont icon-link"></i></a></h2>
<ul>
<li>
<p>DevOps: 版本研发 + 交付上线</p>
<ul>
<li>版本研发：持续交付</li>
<li>流程：敏捷开发</li>
</ul>
</li>
<li>
<p>开发过程</p>
<ul>
<li>集成 Integration：编译、测试、打包</li>
<li>部署 Deployment：应用组件或基本设施的代码或配置变更在产品环境生效称为“部署”</li>
<li>发布 Release：具有业务影响的功能变化对最终用户可见</li>
<li>交付 Delivery：从 Deployment 到 Release 之间的阶段，更多的强调的是一种能力</li>
</ul>
</li>
<li>
<p>三个阶段</p>
<ul>
<li>
<p>Flow 宏观思维：开发发布自动化</p>
<ul>
<li>
<p>持续集成：开发人员提交了新代码之后，立刻进行构建、(单元)测试</p>
<p>Maven, Gradle, Jenkins, Gitlab Cl</p>
</li>
<li>
<p>持续交付：将集成后的代码部署到更贴近真实运行环境的「类生产环境」中</p>
<p>Docker, Vagrant, Logstash</p>
</li>
<li>
<p>持续部署</p>
</li>
<li>
<p>持续演化</p>
</li>
</ul>
</li>
</ul>
</li>
<li>
<p>Feedback 反馈闭环：确保反馈的稳定提供，且包括缩短和优化反馈循环，以便人们尽可能快地 自动收到反馈</p>
</li>
<li>
<p>Continual Learning 持续的验证和提升的文化</p>
</li>
</ul>
<h2 id="代码重构">代码重构<a href="#代码重构" class="anchor" aria-hidden="true"><i class="iconfont icon-link"></i></a></h2>
<h3 id="代码坏味道">代码“坏味道”<a href="#代码坏味道" class="anchor" aria-hidden="true"><i class="iconfont icon-link"></i></a></h3>
<ul>
<li>重复代码</li>
<li>过长函数 (Long Method)/过大的类 (Large Class)：将查询函数和修改函数分离</li>
<li>过长参数列表 (Long Parameter List)/无用函数参数（Unused Function Parameter）：移除参数</li>
<li>不可读或者可读性差的变量名和函数名 (unread variable or function name)：重命名</li>
<li>异曲同工类（Alternative Classes with Different Interfaces）
<ul>
<li>令函数携带参数</li>
</ul>
</li>
<li>Switch 过多使用（Switch Abuse）：以明确函数取代参数</li>
<li>冗余类（Lazy Class）/冗余函数（Lazy Function）</li>
<li>函数圈复杂度超过 10（The Complexity is over 10）</li>
<li>依恋情结（Feature Envy）</li>
<li>过度扩展设计（Over-extend design）</li>
<li>过度耦合的消息链（Message Chains）</li>
<li>令人迷惑的临时字段（Temporary Field）</li>
<li>过多注释 (Too Many Comments)</li>
</ul>
<h3 id="重构技巧">重构技巧<a href="#重构技巧" class="anchor" aria-hidden="true"><i class="iconfont icon-link"></i></a></h3>
<ul>
<li>反射去除分支结构</li>
<li>多态取代条件表达式</li>
</ul>
<h3 id="重构工具">重构工具<a href="#重构工具" class="anchor" aria-hidden="true"><i class="iconfont icon-link"></i></a></h3>
<ul>
<li>代码质量管理工具
<ul>
<li>SonarQube</li>
</ul>
</li>
<li>重复代码检测工具
<ul>
<li>PMD</li>
<li>Simian</li>
</ul>
</li>
</ul>
<h2 id="开源工具">开源工具<a href="#开源工具" class="anchor" aria-hidden="true"><i class="iconfont icon-link"></i></a></h2>
<table>
<thead>
<tr>
<th></th>
<th>例</th>
</tr>
</thead>
<tbody>
<tr>
<td>数据库</td>
<td>Oracle, MySQL, Cassandra</td>
</tr>
<tr>
<td>持续集成</td>
<td>Jenkins, TeamCity，Github Actions</td>
</tr>
<tr>
<td>部署</td>
<td>SSH, XLDeploy</td>
</tr>
<tr>
<td>云/laaS,PaaS</td>
<td>Amazon Web Servies, Azure</td>
</tr>
<tr>
<td>业务分析/监控</td>
<td>Splunk, Nagios</td>
</tr>
<tr>
<td>配置管理</td>
<td>Git, SVN</td>
</tr>
<tr>
<td>库管理</td>
<td>Nexus, NuGet</td>
</tr>
<tr>
<td>配置/服务开通</td>
<td>Chef, Puppet, Ansible, Vagrant</td>
</tr>
<tr>
<td>发布管理</td>
<td>XL Release, UrbanCode Release</td>
</tr>
<tr>
<td>日志</td>
<td>Sumo Logic, Logstash</td>
</tr>
<tr>
<td>构建</td>
<td>Gradle, Ant, Maven</td>
</tr>
<tr>
<td>测试</td>
<td>Junit, Cucumber, Selenium, Jmeter, Appium</td>
</tr>
<tr>
<td>容器化</td>
<td>Docker, Kubernetes, Mesos</td>
</tr>
<tr>
<td>协作</td>
<td>Jira, Flowdock</td>
</tr>
<tr>
<td>安全</td>
<td>Snort, CyberArk</td>
</tr>
</tbody>
</table>

						</div>
					</main>
					<div class="d-none d-lg-block col-lg-3 bd-toc d-print-none">
						<div class="btn-group-vertical w-100 my-3">
    
    <a class="btn btn-outline-secondary text-dark w-100 p-2" href="https://list.html" target="_blank">
        <i class="iconfont icon-LC_icon_list_line"></i><br />待更新列表
    </a>
    

    
    <a class="btn btn-outline-secondary text-dark w-100 p-2" href="mailto:littlegreedy@qq.com"
        target="_blank">
        <i class="iconfont icon-discussion"></i><br />纠错与咨询
    </a>
    
    
    
    
        <a class="btn btn-outline-secondary text-dark w-100 p-2" href="#" onclick="window.print()">
            <i class="iconfont icon-dayin"></i><br />打印本页
        </a>
    
    
</div>
						<h4 class="card-title pb-0">目录</h4>
						<nav id="TableOfContents">
  <ul>
    <li><a href="#软件支持">软件支持</a></li>
    <li><a href="#软件维护">软件维护</a></li>
    <li><a href="#软件演化">软件演化</a></li>
    <li><a href="#devops">Devops</a></li>
    <li><a href="#代码重构">代码重构</a>
      <ul>
        <li><a href="#代码坏味道">代码“坏味道”</a></li>
        <li><a href="#重构技巧">重构技巧</a></li>
        <li><a href="#重构工具">重构工具</a></li>
      </ul>
    </li>
    <li><a href="#开源工具">开源工具</a></li>
  </ul>
</nav>
						
						
						<div id="disqus_thread"></div>
							<script>
							

							

							(function() { 
							var d = document, s = d.createElement('script');
							s.src = "https://"+"your site name on disqus"+".disqus.com/embed.js";
							s.setAttribute('data-timestamp', +new Date());
							(d.head || d.body).appendChild(s);
							})();
							</script>
							<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>                  
					  	</div>
						
					</div>
				</div>
			</div>
		</div>
	</div>

	<script
    src="https://code.jquery.com/jquery-3.4.1.min.js"
    integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
    crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script><script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>

<script type="text/javascript" src="https://fziks.gitee.io/custom.min.d3e1b7647f32dbe7e0140398739a26dad3f3470fc1eebe0741ef33668f1b7bd0b2917dc6efb9f0d9f1092b91dca502cab1b883863f02530133a8a8ef609926af.js" integrity="sha512-0&#43;G3ZH8y2&#43;fgFAOYc5om2tPzRw/B7r4HQe8zZo8be9CykX3G77nw2fEJK5HcpQLKsbiDhj8CUwEzqKjvYJkmrw=="></script>
<script type="text/javascript">

document.addEventListener("DOMContentLoaded", function () {
    renderMathInElement(
        document.body, {
            delimiters: [
                {
                    left: "$$",
                    right: "$$",
                    display: true
                },
                {
                    left: "\\[",
                    right: "\\]",
                    display: true
                },
                {
                    left: "$",
                    right: "$",
                    display: false
                },
                {
                    left: "\\(",
                    right: "\\)",
                    display: false
                }
            ],
            strict: false
        }
    );
});


$(document).on('click', 'a[href^="#"]', function (event) {
    event.preventDefault();

    $('html, body').animate({
        scrollTop: $($.attr(this, 'href')).offset().top
    }, 500);
});
</script>




</body>

</html>